import request from '@/utils/request'

// 查询科室列表
export function listDepartment(query) {
  return request({
    url: '/biz/department/list',
    method: 'get',
    params: query
  })
}

// 查询医院下所有的科室列表
export function getAllDepartmentListByHospital(hospitalId) {
  return request({
    url: '/biz/department/getAllDepartmentList/'+hospitalId,
    method: 'get',
  })
}
// 查询医院下所有的科室列表-分页
export function getAllDepartmentPageByHospital(query) {
  return request({
    url: '/biz/department/getAllDepartmentPage',
    method: 'get',
    params: query
  })
}

// 查询科室详细
export function getDepartment(id) {
  return request({
    url: '/biz/department/' + id,
    method: 'get'
  })
}

// 新增科室
export function addDepartment(data) {
  return request({
    url: '/biz/department',
    method: 'post',
    data: data
  })
}

// 修改科室
export function updateDepartment(data) {
  return request({
    url: '/biz/department',
    method: 'put',
    data: data
  })
}

// 删除科室
export function delDepartment(id) {
  return request({
    url: '/biz/department/' + id,
    method: 'delete'
  })
}

// 启用禁用科室
export function changeStatus(data) {
  return request({
    url: '/biz/department/changeStatus',
    method: 'put',
    data: data
  })
}
